package fhp.hlhj.giantfold.module

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.javaBean.UserInfoBean
import fhp.hlhj.giantfold.network.UrlApis

/**
 * author: FHP
 * data: on 2018\1\19 0019 10:14
 * E-Mail: 103945089@qq.com
 */
class UserInfoModule {
    interface UserInfoListener{
        fun showLoading()
        fun onLoadInfoListener(userInfoBean: UserInfoBean)
    }

    fun getUser(params: HttpParams,listener: UserInfoListener){
        UrlApis.getUserInfo(params)
                .doOnSubscribe {
                    listener.showLoading()
                }
                .subscribe {
                    data
                    ->
                    listener.onLoadInfoListener(data)
                }
    }
}